package com.xposed.aliproxy.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;

import com.xposed.aliproxy.R;
import com.xposed.aliproxy.db.DBUtil;
import com.xposed.aliproxy.qrcode.QRCodeModel;
import com.xposed.aliproxy.utils.ParamConfig;
import com.xposed.aliproxy.utils.Utils;

import org.json.JSONObject;

public class AliQRCodeReceiver extends BroadcastReceiver {
    private Context context;

    public AliQRCodeReceiver(Context context, DBUtil dBUtil, ParamConfig paramConfig) {
        this.context = context;
    }

    /* JADX WARNING: Missing block: B:21:0x006b, code:
            return;
     */
    public synchronized void onReceive(Context r7, android.content.Intent r8) {
        /*
        r6 = this;
        monitor-enter(r6);
        r7 = r8.getAction();	 Catch:{ all -> 0x006c }
        r0 = "com.abcd.xpouseali.action.aliqrcode.received";
        r7 = r0.equals(r7);	 Catch:{ all -> 0x006c }
        if (r7 != 0) goto L_0x000f;
    L_0x000d:
        monitor-exit(r6);
        return;
    L_0x000f:
        r7 = "money";
        r7 = r8.getStringExtra(r7);	 Catch:{ all -> 0x006c }
        r0 = "remark";
        r0 = r8.getStringExtra(r0);	 Catch:{ all -> 0x006c }
        r1 = "qrCodeUrl";
        r8 = r8.getStringExtra(r1);	 Catch:{ all -> 0x006c }
        r1 = p029f.GlobalInstance.m2935a();	 Catch:{ all -> 0x006c }
        r1 = r1.f1767f;	 Catch:{ all -> 0x006c }
        r2 = r1.iterator();	 Catch:{ all -> 0x006c }
    L_0x002b:
        r3 = r2.hasNext();	 Catch:{ all -> 0x006c }
        if (r3 == 0) goto L_0x006a;
    L_0x0031:
        r3 = r2.next();	 Catch:{ all -> 0x006c }
        r3 = (p029f.QRCodeModel) r3;	 Catch:{ all -> 0x006c }
        r4 = r3.mo3610d();	 Catch:{ all -> 0x006c }
        r4 = r0.equals(r4);	 Catch:{ all -> 0x006c }
        if (r4 != 0) goto L_0x0042;
    L_0x0041:
        goto L_0x002b;
    L_0x0042:
        r4 = p032i.Utils.m2984b(r7);	 Catch:{ all -> 0x006c }
        r4 = java.lang.Integer.parseInt(r4);	 Catch:{ all -> 0x006c }
        r5 = r3.mo3614f();	 Catch:{ all -> 0x006c }
        r5 = java.lang.Integer.parseInt(r5);	 Catch:{ all -> 0x006c }
        if (r4 == r5) goto L_0x0055;
    L_0x0054:
        goto L_0x002b;
    L_0x0055:
        r3.mo3611d(r8);	 Catch:{ all -> 0x006c }
        r7 = r6.m3016a(r3);	 Catch:{ all -> 0x006c }
        if (r7 == 0) goto L_0x0067;
    L_0x005e:
        r8 = p029f.GlobalInstance.m2935a();	 Catch:{ all -> 0x006c }
        r8 = r8.f1768g;	 Catch:{ all -> 0x006c }
        r8.add(r7);	 Catch:{ all -> 0x006c }
    L_0x0067:
        r1.remove(r3);	 Catch:{ all -> 0x006c }
    L_0x006a:
        monitor-exit(r6);
        return;
    L_0x006c:
        r7 = move-exception;
        monitor-exit(r6);
        throw r7;
        */
        throw new UnsupportedOperationException("Method not decompiled: receiver.AliQRCodeReceiver.onReceive(android.content.Context, android.content.Intent):void");
    }

    /* renamed from: a */
    private String getSignString(QRCodeModel qRCodeModel) {
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("transType", qRCodeModel.getTransType());
            jSONObject.put("inAccount", qRCodeModel.getInAccount());
            jSONObject.put("orderNo", qRCodeModel.getOrderNo());
            jSONObject.put("money", qRCodeModel.getMoney());
            jSONObject.put("qrCodeRemark", qRCodeModel.getQrCodeRemark());
            jSONObject.put("qrCodeUrl", qRCodeModel.getQrCodeUrl());
            jSONObject.put("sign", Utils.formatJson(jSONObject, this.context.getString(R.string.app_xposed_jka)));
            return jSONObject.toString();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
